﻿using Abp.AutoMapper;
using Abp.UI;
using AVIS.OutBound.CarGroups;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AVIS.OutBound.Orders
{
    /// <summary>
    /// 预定单
    /// </summary>
    [AutoMap(typeof(Order))]
    public class BookOrder : OrderBase
    {
        /// <summary>
        /// 订单Id
        /// </summary>
        public string OrderId { get; set; }

        /// <summary>
        /// 订单号，由Wizard接口返回（如：37378367CN5） ReservationNumber
        /// </summary>
        public string OrderNo { get; set; }

        #region 取还车信息

        /// <summary>
        /// 取车门店编号
        /// </summary>
        public string PickUpStoreCode { get; set; }

        /// <summary>
        /// 取车门店名称
        /// </summary>
        public string PickUpStoreName { get; set; }

        /// <summary>
        /// 取车城市编号
        /// </summary>
        public string PickUpCityCode { get; set; }

        /// <summary>
        /// 取车城市名称
        /// </summary>
        public string PickUpCityName { get; set; }

        /// <summary>
        /// 取车的区域编号
        /// </summary>
        public string PickUpRegionCode { get; set; }

        /// <summary>
        /// 还车门店编号
        /// </summary>
        public string ReturnStoreCode { get; set; }

        /// <summary>
        /// 还车门店名称
        /// </summary>
        public string ReturnStoreName { get; set; }

        /// <summary>
        /// 还车城市编号
        /// </summary>
        public string ReturnCityCode { get; set; }

        /// <summary>
        /// 还车城市名称
        /// </summary>
        public string ReturnCityName { get; set; }

        /// <summary>
        /// 还车的区域编号
        /// </summary>
        public string ReturnRegionCode { get; set; }

        /// <summary>
        /// 租期单位（一般为天）
        /// </summary>
        public string RentalUnit { get; set; }
        #endregion

        /// <summary>
        /// 订单总金额
        /// </summary>
        public double Amount { get; set; }

        /// <summary>
        /// 0 门店 1 城市
        /// </summary>
        public string OrderType { get; set; }

        ///<summary>
        ///Avis全球折扣号
        ///</summary>
        public string AWD { get; set; }

        ///<summary>
        ///会员卡号
        ///</summary>
        public string WizardNum { get; set; }

        ///<summary>
        ///优惠券号
        ///</summary>
        public string CouponNum { get; set; }

        ///<summary>
        ///协议号
        ///</summary>
        public string IATA { get; set; }

        /// <summary>
        /// 协议类型
        /// </summary>
        public int IATAType
        {
            get
            {
                if (_IATAType <= 0)
                {
                    return 5; // TODO 为啥默认是 5， 5代表是什么？
                }
                else
                {
                    return _IATAType;
                }
            }
            set
            {
                _IATAType = value;
            }
        }
        private int _IATAType = 0;

        ///<summary>
        ///付款类型1到付2预付
        ///</summary>
        public string PayType { get; set; }

        /// <summary>
        /// 货币编码
        /// </summary>
        public string CurrencyCode { get; set; }

        /// <summary>
        /// 对应上述属性 新预订 1:城市选择 2:门店选择  3:车组选择 4.附件产品选择 5.客户信息输入 6.完成
        /// 修改 0:查询  1:城市选择 2:门店选择  3:车组选择 4.附件产品选择 5.客户信息输入 6.完成
        /// </summary>
        public int OrderStep
        {
            set;
            get;
        }

        /// <summary>
        /// 套餐价格代码
        /// </summary>
        public string RateCode { get; set; }

        /// <summary>
        /// 预订车组的唯一码
        /// </summary>
        public string SIPPCode { get; set; }

        /// <summary>
        /// 客户选中的车辆装备等增值服务（结构：类型 + 数量）
        /// </summary>
        public Dictionary<string, int> Equipments { get; set; }

        ///// <summary>
        ///// 国家名称
        ///// </summary>
        //public string CountryName { get; set; }

    }
}
